﻿<UserControl x:Class="Esponce.Views.TrackListView"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:m="clr-namespace:Esponce.Models"
	xmlns:v="clr-namespace:Esponce.Views"
  mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="400">
	<UserControl.DataContext>
		<m:TrackListViewModel />
	</UserControl.DataContext>
	<Grid x:Name="LayoutRoot">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="10" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="20" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="10" />
			<RowDefinition Height="*" />
		</Grid.RowDefinitions>

		<!-- Input parameters -->
		<TextBlock Grid.Row="0" Text="INPUT PARAMETERS" Style="{StaticResource TitleStyle}" />

		<Grid Grid.Row="2">
			<Border Style="{StaticResource BorderStyle}">
				<Grid Margin="20">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="*" />
						<ColumnDefinition Width="Auto" />
					</Grid.ColumnDefinitions>

					<!--<StackPanel Grid.Column="0" Orientation="Horizontal">
						<TextBlock Text="Skip: " VerticalAlignment="Center" />
						<TextBox Text="{Binding Skip, Mode=TwoWay}" Width="75" Margin="10,0,10,0" />

						<TextBlock Text="Take: " VerticalAlignment="Center" />
						<TextBox Text="{Binding Take, Mode=TwoWay}" Width="75" Margin="10,0,10,0" />

						<TextBlock Text="Since: " VerticalAlignment="Center" />
						<TextBox Text="{Binding Since, Mode=TwoWay}" Width="150" Margin="10,0,10,0" />

						<TextBlock Text="Until: " VerticalAlignment="Center" />
						<TextBox Text="{Binding Until, Mode=TwoWay}" Width="150" Margin="10,0,10,0" />
					</StackPanel>-->

					<Button Grid.Column="1" Content="Request" Padding="7,0,7,2" Click="btnRequest_Click" FontWeight="Bold" />
				</Grid>
			</Border>
		</Grid>

		<!-- Data Grid -->
		<TextBlock Grid.Row="4" Text="OUTPUT DATA" Style="{StaticResource TitleStyle}" />

		<Grid Grid.Row="6">
			<Border Style="{StaticResource BorderStyle}">
				<Grid Margin="20" Background="White">
					<ScrollViewer>
						<ItemsControl ItemsSource="{Binding Items}">
							<ItemsControl.ItemTemplate>
								<DataTemplate>
									<Grid>
										<Grid.RowDefinitions>
											<RowDefinition Height="*" />
											<RowDefinition Height="Auto" />
										</Grid.RowDefinitions>
										<Grid Grid.Row="0" Margin="10,5,10,5" ToolTipService.ToolTip="{Binding Info}">
											<Grid.ColumnDefinitions>
												<ColumnDefinition Width="220" />
												<ColumnDefinition Width="70" />
												<ColumnDefinition Width="*" />
												<ColumnDefinition Width="Auto" />
												<ColumnDefinition Width="130" />
											</Grid.ColumnDefinitions>
											<TextBox Grid.Column="0" Text="{Binding Id}" BorderThickness="0" VerticalAlignment="Center" />
											<TextBlock Grid.Column="1" Text="{Binding Type}" VerticalAlignment="Center" Foreground="#999999" />
											<TextBlock Grid.Column="2" Text="{Binding Name}" VerticalAlignment="Center" FontWeight="Bold" TextWrapping="Wrap" />
											<StackPanel Grid.Column="3" Orientation="Horizontal" VerticalAlignment="Center" Margin="5,0,5,0">
												<TextBlock Text="?" FontWeight="Bold" Visibility="{Binding IsAvailable, Converter={StaticResource VisibilityConverter}, ConverterParameter=Invert}" />
												<TextBlock Text="{Binding Scans}" FontWeight="Bold" Visibility="{Binding IsCampaign, Converter={StaticResource VisibilityConverter}, ConverterParameter=Invert}" />
												<TextBlock Text=" scans" FontWeight="Bold" Visibility="{Binding IsCampaign, Converter={StaticResource VisibilityConverter}, ConverterParameter=Invert}" />
											</StackPanel>
											<TextBlock Grid.Column="4" Text="{Binding Created}" VerticalAlignment="Center" TextAlignment="Right" />
											<!--<Button Grid.Column="3" Content="View" VerticalAlignment="Center" Cursor="Hand" />-->
										</Grid>
										<Path Grid.Row="1" Data="M0,0 L100,0" StrokeDashArray="1 0 1" Stretch="Fill" Stroke="#999999" StrokeThickness="1" Height="1" />
									</Grid>
								</DataTemplate>
							</ItemsControl.ItemTemplate>
						</ItemsControl>
					</ScrollViewer>
				</Grid>
			</Border>
		</Grid>
	</Grid>
</UserControl>
